package com.wsx.ones.monitor.core.codec;

import java.io.IOException;

/**
 * 序列化得主接口
 * Created by wangshuaixin on 17/1/23.
 */
public interface Serialization {

    //序列化得主操作，将对象转变成字节数组
    byte[] serializ(Object object) throws IOException;

    //反序列化，将字节数组转换为相应的对象
    <T> T deserializ(byte[] bytes, Class<T> clazz) throws IOException;

    Object deserializ(byte[] bytes) throws IOException;
}
